CXX=g++

all: minichess

minichess: main.o functions.o generator.o ZobristTable.o TTable.o
	$(CXX) -g main.o functions.o generator.o Move.o TTable.o ZobristTable.o -lpthread -o ../bin/minichess

#test: test.o functions.o generator.o ZobristTable.o TTable.o
#	$(CXX) -g test.o functions.o generator.o Move.o TTable.o ZobristTable.o -o ../bin/test

#testDoUndo: testDoUndo.o functions.o generator.o ZobristTable.o TTable.o
#	$(CXX) -g testDoUndo.o functions.o generator.o Move.o TTable.o ZobristTable.o -o ../bin/testDoUndo

#test.o: test.cpp includes.h data.h
#	$(CXX) -g -c $(CFLAGS) test.cpp

#testDoUndo.o: testDoUndo.cpp includes.h data.h
#	$(CXX) -g -c $(CFLAGS) testDoUndo.cpp

main.o: main.cpp data.h functions.h includes.h
	$(CXX) -g -c $(CFLAGS) main.cpp

functions.o: functions.cpp functions.h data.h includes.h Move.o ZobristTable.o TTable.o
	$(CXX) -g -c $(CFLAGS) functions.cpp

generator.o: generator.cpp generator.h data.h includes.h Move.o ZobristTable.o TTable.o
	$(CXX) -g -c $(CFLAGS) generator.cpp

Move.o: Move.cpp Move.h data.h includes.h
	$(CXX) -g -c $(CFLAGS) Move.cpp

TTable.o: TTable.cpp TTable.h data.h includes.h
	$(CXX) -g -c $(CFLAGS) TTable.cpp

ZobristTable.o: ZobristTable.cpp ZobristTable.h data.h includes.h
	$(CXX) -g -c $(CFLAGS) ZobristTable.cpp

clean: 
	$(RM) *.o core ../bin/core ../bin/minichess ../bin/test ../bin/testDoUndo

